//
//  MyMessageTV.m
//  hnGovernment
//
//  Created by 安仔 on 17/3/6.
//  Copyright © 2017年 安仔. All rights reserved.
//

#import "MyMessageTV.h"
#import "RecordTVCell.h"
#import "WBPopOverView.h"

@interface MyMessageTV ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *myTableView;

@end

@implementation MyMessageTV

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = RGB(243, 243, 243);
    self.title = NSLocalString(@"我的消息");
    
    UIImage *image = [[UIImage imageNamed:@"筛选"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal ];
    UIBarButtonItem *rightbuttonItem =  [[UIBarButtonItem alloc] initWithImage:image style:UIBarButtonItemStylePlain target:self action:@selector(rightFun)];
    self.navigationItem.rightBarButtonItem = rightbuttonItem;

    
    self.myTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight - 128 * m6Scale) style:UITableViewStylePlain];
    self.myTableView.backgroundColor = RGB(243, 243, 243);
    self.myTableView.delegate = self;
    self.myTableView.dataSource = self;
    self.myTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:self.myTableView];
}

- (void)rightFun {
    //CGPoint point = CGPointMake(KScreenWidth - 20.0, 65.0);//箭头点的位置
    //WBPopOverView *view = [[WBPopOverView alloc] initWithOrigin:point Width:176.0*m6Scale Height:190.* m6Scale Direction:WBArrowDirectionUp3];//初始化弹出视图的箭头顶点位置point，展示视图的宽度Width，高度Height，Direction以及展示的方向
    //view.delegate = self;
    //[view popView];
    [SVProgressHUD showInfoWithStatus:@"敬请期待"];

}

#pragma mark - WBPopOverViewDelegate
- (void)clickItemWithIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.row == 1) {
        [SVProgressHUD showSuccessWithStatus:@"功能开发中"];
        
    }else {
        [SVProgressHUD showSuccessWithStatus:@"功能开发中"];
    }
}

#pragma mark - UITableView
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    
    return 1;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return 2;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    RecordTVCell *cell = [self.myTableView dequeueReusableCellWithIdentifier:@"payRecordCell"];
    if (!cell) {
        cell = [[RecordTVCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"payRecordCell"];
    }
    
    cell.recordView.titleLab.text = NSLocalString(@"身份证到期提醒");
    cell.recordView.contentLab.text = NSLocalString(@"二代身份证只要过期时间不久，仍可继续使用。过期不会消磁，刷卡仍能显示机读信息。﻿过期还能用多久，各部门规定不同。如民航规定，有效期限过期六个月内的身份证可作为直接乘机的有效证件.");
    cell.recordView.contentLab.font = [UIFont systemFontOfSize:28 * m6Scale];
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return 422 * m6Scale;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
